﻿Public Class frmConsultaVagaDeTrabalho

    Private vag As New _VagaTrabalho

    Private _idVaga As Integer
    Public Property idVaga() As Integer
        Get
            Return _idVaga

        End Get
        Set(ByVal value As Integer)
            _idVaga = value
        End Set
    End Property

    Private Sub frmConsultaVagaDeTrabalho_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        dgvVagasDeTrabalho.AutoGenerateColumns = False
        dgvVagasDeTrabalho.DataSource = vag.consultaVagasDeTrabalhador().Tables("dataSet")
    End Sub

    Private Sub dgvVagasDeTrabalho_CellMouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles dgvVagasDeTrabalho.CellMouseDoubleClick
        idVaga = dgvVagasDeTrabalho.CurrentRow.Cells("O_ID_VAGADETRABALHO").Value
        Me.DialogResult = Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub btnCadastrarNovaVaga_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCadastrarNovaVaga.Click
        Dim j As New frmCadastroVagaDeTrabalho
        j.ShowDialog()
        dgvVagasDeTrabalho.AutoGenerateColumns = False
        dgvVagasDeTrabalho.DataSource = vag.consultaVagasDeTrabalhador().Tables("dataSet")


    End Sub
End Class